<template>
  <div id="app">
    <keep-alive>
      <component :is="currentView"></component>
    </keep-alive>
  </div>
</template>

<script>
import datav1 from "./components/datav/index.vue";
import datav2 from "./components/datav/quality.vue";
import datav3 from "./components/datav/board.vue";
import datav4 from "./components/datav/board2.vue";
import datav5 from "./components/datav/board3.vue";

export default {
  name: "app",
  components: {
    datav1,
    datav2,
    datav3,
    datav4,
    datav5,
  },
  data() {
    return {
      index: -1,
      arr: ["datav1", "datav1","datav2"],
    };
  },
  computed: {
    currentView() {
      return this.arr[this.index];
      //return this.arr[2];
    },
  },
  methods: {
    Change() {
      this.index = ++this.index % 3 ;
    },
  },
  mounted() {
    const { Change } = this;

    this.Change();

    setInterval(this.Change, 20* 1000);
  },
};
</script>



<style lang="less">
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  width: 100%;
  height: 100%;
}
</style>
